// 本地联调
import { mergeConfig } from 'vite'
import eslintPlugin from 'vite-plugin-eslint'
import baseConfig from './vite.config.base'
import mkcert from 'vite-plugin-mkcert'

export default mergeConfig(
  {
    mode: 'debugging',
    server: {
      host: '0.0.0.0',
      port: 5173,
      https: false, // 启用 TLS + HTTP/2。注意：当 server.proxy 选项 也被使用时，将会仅使用 TLS。
      open: false,
      hmr: true,
      proxy: {
        '/dingdongapi': {
          target: 'http://192.168.10.17:8002',
          changeOrigin: true,
          rewrite: (path) => path.replace('/dingdongapi', '/dingdongapi')
        }
      }
    },
    plugins: [
      eslintPlugin({
        include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue']
      }),
      mkcert()
    ]
  },
  baseConfig
)
